﻿/*****************************************************************************  

 Version: 0.1
 Website: http://www.visuagile.com/
 
 Copyright (c) Yoganand R. All rights reserved.
 For continued development and updates, visit http://yogsbreath.net
 
 ******************************************************************************/

#region Imports

using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;

using VisualAgile.IBLL;
using VisualAgile.IDAL;
using VisualAgile.Model;

#endregion


namespace VisualAgile.BLL
{
    public class IterationManager : BaseManager<Iteration>, IIterationManager
    {
        #region Properties

        public IIterationDao IterationDao { get; set; }

        #endregion

        protected override IBaseDao<Iteration> getBaseDAO()
        {
            return IterationDao;
        }

        /// <summary>
        /// Create a Iteration (the default value contains the return)
        /// </summary>
        /// <returns></returns>
        public Iteration NewIteration()
        {
            var Iteration = new Iteration();

            //System configuration can be used
            Iteration.CreateTime = DateTime.Now;
            Iteration.Name = "New Iteration"; // hard coded default Iteration text
            Iteration.PeriodFrom = DateTime.Now;
            Iteration.PeriodTo = DateTime.Now.AddDays(13);
            
            return Iteration;
        }

        /// <summary>
        /// Access to Iterations
        /// </summary>
        /// <param name="ReleaseName">Release Id</param>
        /// <returns></returns>
        public IList GetByRelease(Guid ReleaseID)
        {
            return IterationDao.FindByRelease(ReleaseID);
        }
    }
}
